# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1TransactionDataUser do
  @moduledoc """
  Details about a user's account involved in the transaction.

  ## Attributes

  *   `accountId` (*type:* `String.t`, *default:* `nil`) - Optional. Unique account identifier for this user. If using account defender, this should match the hashed_account_id field. Otherwise, a unique and persistent identifier for this account.
  *   `creationMs` (*type:* `String.t`, *default:* `nil`) - Optional. The epoch milliseconds of the user's account creation.
  *   `email` (*type:* `String.t`, *default:* `nil`) - Optional. The email address of the user.
  *   `emailVerified` (*type:* `boolean()`, *default:* `nil`) - Optional. Whether the email has been verified to be accessible by the user (OTP or similar).
  *   `phoneNumber` (*type:* `String.t`, *default:* `nil`) - Optional. The phone number of the user, with country code.
  *   `phoneVerified` (*type:* `boolean()`, *default:* `nil`) - Optional. Whether the phone number has been verified to be accessible by the user (OTP or similar).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accountId => String.t() | nil,
          :creationMs => String.t() | nil,
          :email => String.t() | nil,
          :emailVerified => boolean() | nil,
          :phoneNumber => String.t() | nil,
          :phoneVerified => boolean() | nil
        }

  field(:accountId)
  field(:creationMs)
  field(:email)
  field(:emailVerified)
  field(:phoneNumber)
  field(:phoneVerified)
end

defimpl Poison.Decoder,
  for: GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1TransactionDataUser do
  def decode(value, options) do
    GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1TransactionDataUser.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1TransactionDataUser do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
